import request from '@/utils/request'

// 货架信息管理相关接口
export default {
  // 1. 新增货架信息
  addShelf(data) {
    return request({
      url: '/shelf-info/add',
      method: 'post',
      data
    })
  },

  // 2. 货架列表查询
  getShelfList(params) {
    return request({
      url: '/shelf-info/list',
      method: 'get',
      params
    })
  },

  // 3. 货架信息更新
  updateShelf(data) {
    return request({
      url: '/shelf-info/update',
      method: 'post',
      data
    })
  },

  // 4. 货架信息删除
  deleteShelf(id) {
    return request({
      url: '/shelf-info/delete',
      method: 'delete',
      params: {
        shelfId: id
      }
    })
  },

  // PLC与货架绑定关系相关接口
  // 5. 新增PLC与货架绑定关系
  addShelfPlcBinding(data) {
    return request({
      url: '/plc-shelf-joint/add',
      method: 'post',
      data
    })
  },

  // 6. 绑定关系列表查询
  getShelfPlcBindingList(params) {
    return request({
      url: '/plc-shelf-joint/list',
      method: 'get',
      params
    })
  },

  // 7. 删除绑定关系
  deleteShelfPlcBinding(id) {
    return request({
      url: '/plc-shelf-joint/delete',
      method: 'delete',
      params: { id }
    })
  }
}